package com.feihong.txgw.adapter.Holder;

import android.view.View;
import android.widget.TextView;

import com.feihong.txgw.R;
import com.feihong.txgw.json.user.ProductOrderDetailEntity;

import java.util.List;

/**
 * @name txgw_app
 * @class name：com.feihong.txgw.adapter.Holder
 * @class describe:
 * @author wangziheng
 * @time 2017/8/16 12:14
 * @change
 * @chang time
 * @class describe
 */
public class ProductOrderDetailHeadViewHolder extends BaseViewHolder {

    private TextView mOrderStatus;
    private TextView mOrderSn;
    private TextView mOrderAddTime;
    public ProductOrderDetailHeadViewHolder(View itemView) {
        super(itemView);
        mOrderAddTime = (TextView) itemView.findViewById(R.id.product_order_detail_order_time);
        mOrderSn = (TextView) itemView.findViewById(R.id.product_Order_detail_order_num);
        mOrderStatus = (TextView) itemView.findViewById(R.id.product_order_detail_status_title);
    }

    public void initData(List<ProductOrderDetailEntity> mOrderGoods){
        if(mOrderGoods != null && mOrderGoods.size() != 0){
            mOrderAddTime.setText(mOrderGoods.get(0).getAdd_time());
            mOrderSn.setText(mOrderGoods.get(0).getOrder_sn());
            switch (mOrderGoods.get(0).getStatus()){
                case "1":
                    mOrderStatus.setText("待支付");
                    break;
                case "2":
                    mOrderStatus.setText("已付款");
                    break;
                case "3":
                    mOrderStatus.setText("已发货");
                    break;
                case "4":
                    mOrderStatus.setText("已完成");
                    break;
                case "5":
                    mOrderStatus.setText("已取消");
                    break;
                case "6":
                    mOrderStatus.setText("已失败");
                    break;
                case "7":
                    mOrderStatus.setText("退款中");
                    break;
                default:break;
            }
        }
    }
}
